unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, jpeg;

type
  TForm2 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Button2: TButton;
    Memo1: TMemo;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Edit4: TEdit;
    Edit5: TEdit;
    Button3: TButton;
    Memo2: TMemo;
    Label4: TLabel;
    Label5: TLabel;
    Image1: TImage;
    Label6: TLabel;
    Label7: TLabel;
    procedure Button1Click(Sender: TObject);
   // procedure Edit1Change(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);


  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;
  a,b,c, h, m :integer;
  d,p,f:real;
implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
begin
Form2.Close;
end;



procedure TForm2.Button2Click(Sender: TObject);
begin
a:=strtoint(edit1.text);
b:=strtoint(edit2.text);
c:=strtoint(edit3.text);
if (((a+b)<c) or ((a+c)<b) or ((c+b)<a)) then
memo1.text:='treugolnik ne suchestwuet' else
begin
p:=((a+b+c)/2);
d:=sqrt(p*(p-a)*(p-b)*(p-c));
memo1.text:=floattostr(d);
end;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
m:=strtoint(edit4.text);
h:=strtoint(edit5.text);
f:=m*h/2;
memo2.text:=floattostr(f);
end;



end.
